package com.nuaa.ange.rabbitmq;

import com.nuaa.ange.entity.Article;
import lombok.Data;

import java.io.Serializable;

/**
 * @description 用于服务之间消息通讯模板
 * @author 玦离
 * @date 2023/1/2 14:11
 */

@Data
public class PostMqIndexMessage implements Serializable {

    public static final String CREATE = "create";
    public static final String UPDATE = "update";
    public static final String REMOVE = "remove";
    public static final int MAX_RETRY = 3;
    private int postId;
    private String type;
    private Article article;
    private int retry = 0;

    public PostMqIndexMessage() {
    }

    public PostMqIndexMessage(int postId, String type) {
        this.postId = postId;
        this.type = type;
    }

    public PostMqIndexMessage(Article article, String type) {
        this.article = article;
        this.type = type;
    }

    public PostMqIndexMessage(int postId, String type, int retry) {
        this.postId = postId;
        this.type = type;
        this.retry = retry;
    }

}

